using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline.Processors;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;

// Type of data.
using TWrite = TMXExtension.TiledData;

namespace TMXExtension
{
    /// <summary>
    /// Crlass for the reader.
    /// </summary>
    [ContentTypeWriter]
    class TiledWriter : ContentTypeWriter<TWrite>
    {
        /// <summary>
        /// Write the TiledData.
        /// </summary>
        /// <param name="output">The writer.</param>
        /// <param name="value">The object.</param>
        protected override void Write(ContentWriter output, TWrite value)
        {
            // Write the data.
            output.Write(value.Data);
        }

        /// <summary>
        /// Get the reader for the obejct.
        /// </summary>
        /// <param name="targetPlatform">The platform.</param>
        /// <returns>The type of the reader class</returns>
        public override string GetRuntimeReader(TargetPlatform targetPlatform)
        {
            return typeof(lumo.display.object2D.TiledReader).AssemblyQualifiedName;
        }
    }
}
